//
//  ZHFPhotoCell.m
//  GoTraveling
//
//  Created by dllo on 15/12/23.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "ZHFPhotoCell.h"

#import "ZHFPhoto.h"


@interface ZHFPhotoCell ()

@property (nonatomic, strong) UIImageView *imageView;


@end

@implementation ZHFPhotoCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)layoutSubviews {
    
    self.imageView.frame = self.contentView.frame;
}

- (void)createSubView {
    
    self.imageView = [[UIImageView alloc] initWithFrame:self.contentView.frame];
    self.imageView.contentMode = UIViewContentModeScaleAspectFill;
    self.imageView.layer.masksToBounds = YES;
    [self.contentView addSubview:self.imageView];
}

- (void)setPhoto:(ZHFPhoto *)photo {
    
   
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:photo.image_url]];
}



@end
